2006-02-20 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtknotebook.c: Properly update internal state
+ when child visibility changes. (#331785, Sebastien Bacher)
+
* gdk/gdkgc.c (_gdk_gc_update_context): Obtain the
background color from the gc when it is needed. (#331820)
2006-02-20 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtknotebook.c: Properly update internal state
+ when child visibility changes. (#331785, Sebastien Bacher)
+
* gdk/gdkgc.c (_gdk_gc_update_context): Obtain the
background color from the gc when it is needed. (#331820)
GtkRequisition requisition;
GtkAllocation allocation;
- guint mnemonic_activate_signal;
+ gulong mnemonic_activate_signal;
+ gulong notify_visible_handler;
};
#ifdef G_DISABLE_CHECKS
page = list->data;
+ g_signal_handler_disconnect (page->child, page->notify_visible_handler);
+
if (GTK_WIDGET_VISIBLE (page->child) && GTK_WIDGET_VISIBLE (notebook))
need_resize = TRUE;
return TRUE;
}
+
+static void
+page_visible_cb (GtkWidget *page,
+ GParamSpec *arg,
+ gpointer data)
+{
+ GtkNotebook *notebook = (GtkNotebook *)data;
+ GList *list;
+ GList *next = NULL;
+
+ if (notebook->cur_page &&
+ notebook->cur_page->child == page &&
+ !GTK_WIDGET_VISIBLE (page))
+ {
+ list = g_list_find (notebook->children, notebook->cur_page);
+ if (list)
+ {
+ next = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
+ if (!next)
+ next = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
+ }
+
+ if (next)
+ gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next), -1);
+ }
+}
+
/**
* gtk_notebook_insert_page_menu:
* @notebook: a #GtkNotebook
gtk_notebook_switch_focus_tab (notebook, NULL);
}
+ page->notify_visible_handler = g_signal_connect (G_OBJECT (child), "notify::visible", G_CALLBACK (page_visible_cb), notebook);
+
gtk_notebook_update_tab_states (notebook);
if (tab_label)